#
# packet template
#
# Copyright (C) 2009 by chrisv
#          
# See CREDITS for details about who has contributed to this project.
#
# For further information about the pdaXrom project and license conditions
# see the README file.
#

LIBSPE2_VERSION=2.3.0.135
LIBSPE2=libspe2-${LIBSPE2_VERSION}.tar.gz
LIBSPE2_MIRROR=http://switch.dl.sourceforge.net/sourceforge/libspe
LIBSPE2_DIR=$BUILD_DIR/libspe2-2.3.0
LIBSPE2_ENV="$CROSS_ENV_AC"

build_libspe2() {
    test -e "$STATE_DIR/libspe2.installed" && return
    banner "Build libspe2"
    download $LIBSPE2_MIRROR $LIBSPE2
    extract $LIBSPE2
    apply_patches $LIBSPE2_DIR $LIBSPE2
    pushd $TOP_DIR
    cd $LIBSPE2_DIR

    make $MAKEARGS CROSS=${CROSS}|| error "error in makefile"

    install_sysroot_files || error

    # install libspe2.so
    $INSTALL -D -m 644 libspe2.so.2.3.0 $ROOTFS_DIR/usr/lib/libspe2.so.2.3.0 || error
    ln -sf libspe2.so.2.3.0 $ROOTFS_DIR/usr/lib/libspe2.so.2
    ln -sf libspe2.so.2.3.0 $ROOTFS_DIR/usr/lib/libspe2.so
    $STRIP $ROOTFS_DIR/usr/lib/libspe2.so.2.3.0

    popd
    touch "$STATE_DIR/libspe2.installed"
}

build_libspe2

